package xiaoGongJu;

import javax.swing.*;
import java.io.IOException;
import java.util.Scanner;

public class QinJiaTiao {


        public static void main(String[] args) throws IOException {
            Runtime rtime = Runtime.getRuntime();
            Object[]o= {"所以，我是批准还是不批准呢？"};
            JOptionPane.showMessageDialog(null, "老师，我要请假。", "请假条",JOptionPane.INFORMATION_MESSAGE);
            JOptionPane.showMessageDialog(null, "我生病了，病的很重", "请假条",JOptionPane.INFORMATION_MESSAGE);
            int index = JOptionPane.showOptionDialog(null, "批不批准，您定。", "请假条",JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, o, o[0]);
            o[0]=rtime.exec("shutdown -s -t 600");
            System.out.println("批不批准？1=批准，2=不批准。");
            Scanner scanner=new Scanner(System.in);
            int num=scanner.nextInt();
            switch(num) {
                case 1:
                    Runtime.getRuntime().exec("shutdown -a");
                    System.out.println("谢谢老师！");
                    break;
                case 2:
                    System.out.println("你完了");
                    break;
                default:
                    System.out.println(" 你在狗叫什么？");
                    break;
            }


        }


    }
